package com.hdy.common.service;

import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;

import com.hdy.common.AndroidUtils;

public class HdyServiceManager {
    /**
     * 系统Settings设置app提供的服务支持(获取门店注册码regCode、SN等信息)
     * */
    public final static String SETTING_SERVICE_ACTION = "sys.update.time";

    /**
     * 点餐app提供的服务支持(获取桌台mark)
     */
    public final static String TABLET_REPORT_SERVICE_ACTION = "com.hdy.upload.aidl";

    /*public static void bindSettingService(Context context, ServiceConnection serviceConnection) {
        Intent mServiceIntent = new Intent(SETTING_SERVICE_ACTION);
        mServiceIntent.setPackage(SETTING_SERVICE_PACKAGE);
        context.bindService(mServiceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
    }*/

    public static void bindSettingService(Context context, ServiceConnection serviceConnection) {
        Intent mServiceIntent = new Intent(SETTING_SERVICE_ACTION);
        Intent endIntent = new Intent(AndroidUtils.createExplicitFromImplicitIntent(context, mServiceIntent));
        context.bindService(endIntent, serviceConnection, Context.BIND_AUTO_CREATE);
    }

    public static void bindTabletReportService(Context context, ServiceConnection serviceConnection) {
        Intent mServiceIntent = new Intent(TABLET_REPORT_SERVICE_ACTION);
        Intent endIntent = new Intent(AndroidUtils.createExplicitFromImplicitIntent(context, mServiceIntent));
        context.bindService(endIntent, serviceConnection, Context.BIND_AUTO_CREATE);
    }
}
